import numpy as np 

def get_top(arr):
    max_arr = []
    max_arr_index = []
    max = 0
    for i in range(5):
        max = np.max(arr[i])
        max_arr.append(max)
        max_ind = (i,np.argmax(arr[i]))
        max_arr_index.append(max_ind)

    return max_arr,max_arr_index



arr = np.array([[1,1,1,1,5],
                [1,1,1,1,1],
                [1,1,5,1,1],
                [1,1,1,1,1],
                [1,1,1,1,1]])

b = arr.ravel()
top_k = 2
top_k_index = b.argsort()[::-1][0:top_k]
ori_index = []
for ind in top_k_index:
    row = ind // 5
    col = ind % 5
    ori_index.append((row,col))

    print(ori_index)
